package com.bwie.controller;
import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.vo.CodeVo;
import com.bwie.vo.LoginVo;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* (t_user)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/user/index")
public class UserController {
/**
* 服务对象
*/
    @Autowired
    private UserService userService;

    //获取验证码
    @PostMapping("/code01")
    public R code01(){
       return userService.code01();
    }

    //手机号发送验证码
    @PostMapping("/sendCode")
    public R sendCode(@RequestBody CodeVo codeVo){
        return userService.sendCode(codeVo);
    }

    //登录
    @PostMapping("/login")
    public R login(@RequestBody LoginVo loginVo){
        return userService.login(loginVo);
    }

}
